package store

import (
	"context"
	"manager/model"
	"manager/model/entity"
)

type IEbike interface {
	IExecTx
	CreateInBatch(ctx context.Context, m []*entity.Ebike) error
	Create(ctx context.Context, e *entity.Ebike) (int64, error)
	Find(ctx context.Context, id int64) (*entity.Ebike, error)
	FindBySnCode(ctx context.Context, sn string) (*entity.Ebike, error)
	Update(ctx context.Context, id int64, updates map[string]interface{}) error
	Delete(ctx context.Context, id int64) error
	List(ctx context.Context, in *model.EbikeListRequest) (int, []*entity.Ebike, error)
	AppList(ctx context.Context, id int64) ([]*model.EbikeAppListResponse, error)
	FindByParameter(ctx context.Context, info *model.EbikeInfo) (*entity.Ebike, error)
	UnBind(ctx context.Context, userId int64, ebikeId int64, isManager bool) error
	WebList(ctx context.Context, in *model.EbikeListRequest) (int64, []*model.EbikesInfoResponse, error)
	Count(ctx context.Context) (*model.EbikeCountResponse, error)
	Bind(ctx context.Context, sn string, userID int64) error
	FindBySn(ctx context.Context, sn string) (*model.AppEbikeFindBySnResponse, error)
	Upload(c context.Context, ebikes []entity.Ebike, controls []entity.Control, batterys []entity.Battery) error
	FindBySns(sn []string) ([]int64, error)
	FindEBikeBySN(ctx context.Context, sn string) (bike entity.Ebike, err error)
	GetCountByTypeId(ctx context.Context, typeID []int64) (int64, error)
}
